﻿using Microsoft.SharePoint;
using SKN;

namespace SPCoreConsole
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (var site = new SPSite("http://localhost"))
            {
                using (SPWeb web = site.RootWeb)
                {
                    //Testing Web

                    //Pass
                    Web.AddTeamWeb(web, "spcore", "SPCore Team site", "created by SPCore", false);
                    Web.AddBlankWeb(web, "spcoreblank", "SPCore Blank site", "created by SPCore", false);
                    Web.SetBrandingOptions(web, "/_layouts/images/actionssettings.gif", "", "", "simple");

                    //Fail
                    //Web.SetWelcomePage(web, "home.aspx"); 

                    //Testing Webpart

                    //Pass
                    string cqwpDefinition = Webpart.ContentQueryWebpartDwp("Hello", @"<font size=2 color=red>Hello</font>");
                    Webpart.AddWebPart(web, "default.aspx", cqwpDefinition, "Left");
                    Webpart.DeleteWebPart(web, "default.aspx", "hello");
                  //  Webpart.ListViewWebPart(web, "default.aspx", "Links", "Left");

                    //Fail

                    //Testing List
                    List.CreateList(web, "favorites", "links");
                }
            }

            //Settings oAddress = SPCoreConsole.ReadXML.Deserialize(@"../../settings.xml");
            //Console.WriteLine(oAddress.Zip);
            //Console.Read();
        }
    }
}